<template>
	<view class="autosplit">
		<Hearder :name="'自动拆分'"></Hearder>
		<view class="itemList bgbottom">
			<view>设置自动拆分金额:</view>
			<input placeholder="请输入金额" placeholder-style="color:#999" v-model="split_price"/>
		</view>
		<view class="surebtn" @click="suremodify">确定设置</view>
		<!-- <view class="tips"><text>*</text>提示文字提示文字提示文字提示文字提示文字</view> -->
	</view>
</template>

<script>
	export default {
		data(){
			return{
				split_price:'',
				space_id:''
			}
		},
		onLoad(options) {
			this.space_id = options.space_id
		},
		methods:{
			suremodify(){
				this.request('/space/toSpace',{split_price:this.split_price,space_id:this.space_id}).then(res => {
					if(res.data.code==1){
						this.$tip(res.data.msg)
						setTimeout(()=>{
							uni.navigateBack()
						},500)
					}else{
						this.$tip(res.data.msg)
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.autosplit{
		/deep/ .fixedhead .head{
			border-bottom: 1rpx solid #F8F8F8;
		}
		.itemList{
			display: flex;
			align-items: center;
			overflow: hidden;
			padding: 30rpx 4%;
			view{
				width: 40%;
			}
			input{
			  width: 60%;
			  height: 80%;
			  margin-left: 64rpx;
			  margin-top: 2rpx;
			  text-align: right;
			}
		}
		.surebtn{
			background: $uni-item-color;
			text-align: center;
			line-height: 88rpx;
			height: 88rpx;
			color: #fff;
			margin: 26rpx 4%;
			font-size: 32rpx;
		}
		.tips{
			font-size: 24rpx;
			color: #999;
			margin: 47rpx 4%;
			text{
				font-size: 28rpx;
				color: $uni-item-color;
			}
		}
	}
</style>